package com.lbd.finance.bean;

import com.lbd.base.bean.AbstractEntity;
import com.lbd.system.bean.User;
import lombok.*;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.jeecgframework.poi.excel.annotation.Excel;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import java.math.BigDecimal;
import java.util.Date;

@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@DynamicUpdate
@Entity
/**
 * 交易记录-用户
 */
public class UserTradeDetail extends AbstractEntity {

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "user_id")
    @Fetch(FetchMode.SELECT)
    //用户ID
    private User user;
    //交易单号
    @Excel(name = "交易单号")
    private String trdNo;
    //交易类型
    private Integer trdType;

    //交易方向
    private Integer trdDirec;

    //交易金额
    @Excel(name = "交易金额（元）")
    private BigDecimal trdAmt;
    //手续费/平台服务费
    @Excel(name = "手续费/平台服务费")
    private BigDecimal fee;
    //到账金额
    @Excel(name = "到账金额（元）")
    private BigDecimal arriAmt;
    //可用金额
    @Excel(name = "可用金额（元）")
    private BigDecimal balance;
    //详情
    @Excel(name = "详情")
    private String remark;
    //交易时间
    private Date trdTime;
    //手续费支付方 1:平台 2:用户
    private Integer serviceChargeParty;
}
